home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
arachne.igz
/
arachne.img
/
LEVEL0
/
LPPRD.CAB
/
Bin
/
lpprd.bat
next >
Wrap
DOS Batch File
|
2005-01-16
|
7KB
|
203 lines
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: lpprd Begin ::
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\tfind.com %0 : _error missing tfind.com (check utils.%arcext%)
if not exist %ramdrv%\bin\wbat.com %0 : _error missing wbat.com (check utils.%arcext%)
if not exist %ramdrv%\bin\varset.com %0 : _error missing varset.com (check utilz.%arcext%)
if not exist %ramdrv%\bin\inifile.com %0 : _error missing inifile.com (check utilz.%arcext%)
if not exist %ramdrv%\bin\pprd.exe %0 : _error missing pprd.exe (check lpprd.%arcext%)
if "%wattcp.cfg%"=="" %0 : _error missing WATTCP
if not exist %wattcp.cfg%\wattcp.cfg %0 : _error missing %wattcp.cfg%\wattcp.cfg
if exist PROTMAN$ if not exist PKTDRV$ %0 : _error MsClient packet driver missing (MSNET)
if not exist %ramdrv%\bin\pktchk.com goto _npktchk
%ramdrv%\bin\pktchk.com 0x20 0xff >nul
if errorlevel 1 %0 : _error missing packet driver
:_npktchk
:_start
echo. >%tmp%\_lpprd.tmp
if not exist %ramdrv%\etc\global.set goto _noglob
type %ramdrv%\etc\global.set >%tmp%\_lpprd.tmp
:_noglob
if not exist %ramdrv%\etc\lpprd.set goto _nospec
type %ramdrv%\etc\lpprd.set >%tmp%\_lpprd.tmp
:_nospec
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*LPPRD_.+=" %tmp%\_lpprd.tmp >%tmp%\_lpprd.bak
if errorlevel 1 goto _noset
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_lpprd.bak >%tmp%\_lpprd.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_lpprd.bak >%tmp%\_lpprd.tmp
if errorlevel 1 goto _runset
lmod /L* set []<%tmp%\_lpprd.tmp >>%tmp%\_lpprd.bat
:_runset
call %tmp%\_lpprd.bat
:_noset
if "%lpprd_ti%"=="" set lpprd_ti=10
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%lpprd_ncfg%"=="1" goto _nocfg
wbat box @%0:w_cfg #1,%lpprd_ti%
if errorlevel 3 goto _end
if errorlevel 2 goto _config
:_nocfg
:_install
echo LPPRD: Installing Print Server
inifile %wattcp.cfg%\wattcp.cfg [] txbufsize=8192
if errorlevel 1 %0 : _error problem writing %wattcp.cfg%\wattcp.cfg
inifile %wattcp.cfg%\wattcp.cfg [] rxbufsize=8192
if errorlevel 1 %0 : _error problem writing %wattcp.cfg%\wattcp.cfg
inifile %wattcp.cfg%\wattcp.cfg [] printer1name="%lpprd_1%"
if errorlevel 1 %0 : _error problem writing '%wattcp.cfg%\wattcp.cfg'
inifile %wattcp.cfg%\wattcp.cfg [] printer2name="%lpprd_2%"
if errorlevel 1 %0 : _error problem writing '%wattcp.cfg%\wattcp.cfg'
inifile %wattcp.cfg%\wattcp.cfg [] printer3name="%lpprd_3%"
if errorlevel 1 %0 : _error problem writing '%wattcp.cfg%\wattcp.cfg'
if not exist %ramdrv%\etc\lpprd.cfg goto _nopcfg
type %ramdrv%\etc\lpprd.cfg >%tmp%\_lpprd.tmp
:_loop
lmod /L set _lpprd=[$1,L]<%tmp%\_lpprd.tmp >%tmp%\_lpprd.bat
linex 2- <%tmp%\_lpprd.tmp >%tmp%\_lpprd.bak
type %tmp%\_lpprd.bak >%tmp%\_lpprd.tmp
set _lpprd=
call %tmp%\_lpprd.bat
if "%_lpprd%"=="" goto _loopdone
if "%_lpprd%"=="print" goto _loop
inifile %wattcp.cfg%\wattcp.cfg [] %_lpprd%=
goto _loop
:_loopdone
if not exist %ramdrv%\etc\lpprd.cfg goto _nopcfg
type %ramdrv%\etc\lpprd.cfg >>%wattcp.cfg%\wattcp.cfg
:_nopcfg
if "%lpprd_1%"=="" if "%lpprd_2%"=="" if "%lpprd_3%"=="" goto _nend
set _lpprd=
if "%lpprd_1%"=="" set _lpprd=%_lpprd%1
if "%lpprd_2%"=="" set _lpprd=%_lpprd%2
if "%lpprd_3%"=="" set _lpprd=%_lpprd%3
if not "%_lpprd%"=="" set _lpprd=-%_lpprd%
if "%lpprd_3%"=="" if "%lpprd_2%"=="" set _lpprd=%_lpprd% -n1
if "%lpprd_3%"=="" if not "%lpprd_2%"=="" set _lpprd=%_lpprd% -n2
echo LPPRD: NwDsk Print Server Setup by Erwin Veermans
echo LPPRD: http://www.veder.com/nwdsk/ (mailto:NwDsk@Veder.com)
echo LPPRD: Loading PPRD printer %lpprd_1% %lpprd_2% %_lpprd_3% %_lpprd% %1 %2 %3 %4 %5 %6 %7 %8
%ldh% %ramdrv%\bin\pprd.exe %_lpprd% %1 %2 %3 %4 %5 %6 %7 %8
goto _end
:_config
echo :w_config "WATTCP Print Server configuration" [x]>%tmp%\_lpprd.tmp
echo.>>%tmp%\_lpprd.tmp
echo Dialog timeout [$ lpprd_ti,3] seconds>>%tmp%\_lpprd.tmp
echo.>>%tmp%\_lpprd.tmp
echo [!] Skip "Run PPRD or go config?" dialog>>%tmp%\_lpprd.tmp
echo.>>%tmp%\_lpprd.tmp
echo Printer 1 : [$ lpprd_1,8,U]>>%tmp%\_lpprd.tmp
echo Printer 2 : [$ lpprd_2,8,U]>>%tmp%\_lpprd.tmp
echo Printer 3 : [$ lpprd_3,8,U]>>%tmp%\_lpprd.tmp
echo.>>%tmp%\_lpprd.tmp
echo [ Save ] [? Cancel ]>>%tmp%\_lpprd.tmp
set wcb1=%lpprd_ncfg%
call w.bat box @%tmp%\_lpprd.tmp:w_config
if errorlevel 2 goto _end
set lpprd_ncfg=%wcb1%
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _start
echo LPPRD: Saving configuration...
set | tfind /f1,6 "LPPRD_">%tmp%\_lpprd.bat
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %ramdrv%\etc\global.set goto _yglob
xgrep -syv "^[:s]*@*[:s]*s?e?t?[:s]*LPPRD_.+=" %ramdrv%\etc\global.set >>%tmp%\_lpprd.bat
:_yglob
type %tmp%\_lpprd.bat >%srcdrv%\etc\global.set
type %tmp%\_lpprd.bat >%ramdrv%\etc\global.set
if exist %srcdrv%\etc\lpprd.set del %srcdrv%\etc\lpprd.set >nul
if exist %ramdrv%\etc\lpprd.set del %ramdrv%\etc\lpprd.set >nul
echo LPPRD: Configuration saved to %srcdrv%\etc\global.set
echo.
goto _start
:w_cfg "Run PPRD or go config?" [x]
(~press any key~: #? sec.)
Running WATTCP Print Server:
%lpprd_1% %lpprd_2% %lpprd_3%
[ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
If the disk in drive %srcdrv% is write
protected, please disable the write
protection now in order to save settings.
You can re-enable write protection after
saving.
[ Ok ] [? Cancel ]
::
:_help
:_usage
echo.
echo LPPRD: Launch PPRD.EXE (WATTCP LPD Print Server)
echo.
echo Needs wattcp.cfg and packet driver installed
echo - Novell NWLAN 32bit (NLM) + packet driver
echo - Novell NWLAN 16bit (VLM) + packet driver
echo - Microsoft MSNET tcpip + packet driver
echo.
echo Download full package and instructions from:
echo http://www.smashco.com/wattcp/pprd200.zip
echo.
@pause
goto _end
:_error
shift
shift
echo.
echo LPPRD (error) %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo LPPRD: Aborted...
echo.
@rem pause
goto _end
:_nend
echo LPPRD: No Printer defined
:_end
set | tfind /f1,2 "W_" >%tmp%\_lpprd.tmp
set | tfind /f1,6 "lpprd_" >>%tmp%\_lpprd.tmp
type %tmp%\_lpprd.tmp | lmod /L* /B= set [$1]=>%tmp%\_lpprd.bat
call %tmp%\_lpprd.bat
if exist %tmp%\_lpprd.* del %tmp%\_lpprd.*
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
set _lpprd=
:: lpprd End ::